/*
 * Copyright 2007, 2008 Tiberiumlabs
 *
 * This file is part of Tiberiumlabs Lailaps.
 *
 * Tiberiumlabs Lailaps is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Tiberiumlabs Lailaps is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.tiberiumlabs.lailaps;

import org.tiberiumlabs.lailaps.actions.ActionFactory;
import org.tiberiumlabs.lailaps.downloads.DownloadManager;
import org.tiberiumlabs.lailaps.gui.GuiBuilder;
import org.tiberiumlabs.lailaps.settings.Settings;

/**
 *
 * @author <a href="mailto:paranoid.tiberiumlabs@gmail.com">Paranoid</a>
 */
public class Mediator {

    protected static void init(Settings settings) {
        mediator = new Mediator(settings);
        mediator.actionFactory = new ActionFactory();
        mediator.guiBuilder = new GuiBuilder();
        mediator.downloadManager = new DownloadManager(settings);
    }

    // <editor-fold defaultstate="collapsed" desc=" singleton implementation ">

    private Mediator(Settings settings) {
        this.settings = settings;
    }

    private static Mediator mediator;

    public static Mediator getMediator() {
        return mediator;
    }

    // </editor-fold>

    private GuiBuilder guiBuilder;

    public GuiBuilder getGuiBuilder() {
        return guiBuilder;
    }

    private ActionFactory actionFactory;

    public ActionFactory getActionFactory() {
        return actionFactory;
    }

    private DownloadManager downloadManager;

    public DownloadManager getDownloadManager() {
        return downloadManager;
    }

    private final Settings settings;

    public Settings getSettings() {
        return settings;
    }

}
